[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 puttext()               Copy Text From Memory to Screen

 #include <conio.h>

 int        puttext(left,top,right,bottom,source);
 int        left;
 int        top;
 int        right;
 int        bottom;
 void       *source;

    puttext() copies the contents of an area of memory pointed to by
    'source' to a rectangular screen area bordered by absolute screen
    coordinates ('left','top'), ('right','bottom').

    The number of bytes of memory needed to originally store the screen
    information is:

            #bytes = (#rows) x (#columns) x 2

    This is because each screen position takes 2 bytes of memory. (The
    first byte is the cell character and the second is the cell's video
    attribute.)

       Returns:     1, if successful. 0 is returned on failure.

   Portability:     IBM PC & BIOS-Compatables only.

   -------------------------------- Example ---------------------------------
    The following statements fill part of the screen with characters,
    store those characters in memory and put them back on the screen in a
    different place.

           #include <conio.h>

           main()
           {
               char buffr[20*10*2];
               int x, y;

               for (y = 0; y < 9; y++) {
                    for (x = 0; x < 19; x++)
                         printf("d");
                    printf("\n");
               }
               gettext(1,1,20,10,buffr);
               getch();
               clrscr();
               puttext(30,12,49,21,buffr);
           }


See Also: gettext() movetext()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson